<html>
<head><meta charset="utf-8"><title>nll-regression · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nll-regression.html">nll-regression</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="182250345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/nll-regression/near/182250345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zoxc <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nll-regression.html#182250345">(Nov 30 2019 at 18:41)</a>:</h4>
<p>Why is this code an error now? <a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=35bb12de17c51e5eeb6193ae8dfbf40f" target="_blank" title="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=35bb12de17c51e5eeb6193ae8dfbf40f">https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=35bb12de17c51e5eeb6193ae8dfbf40f</a><br>
And where does the <code>'static</code> bound come from?<br>
cc <span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="182251110"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/nll-regression/near/182251110" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nll-regression.html#182251110">(Nov 30 2019 at 19:05)</a>:</h4>
<p><span class="user-mention" data-user-id="116466">@Zoxc</span>  fwiw, this works instead of the existing -- I suspect the closure getting generated for the map perhaps isn't quite accepting enough (e.g., coerces the <code>'hir</code> and <code>'_</code> to be the same or something?)</p>
<div class="codehilite"><pre><span></span><span class="w">            </span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="o">*</span><span class="n">this</span><span class="p">;</span><span class="w"></span>
<span class="w">            </span><span class="kd">let</span><span class="w"> </span><span class="n">p</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">None</span><span class="p">.</span><span class="n">map</span><span class="p">(</span><span class="o">|</span><span class="n">x</span>: <span class="kt">u32</span><span class="o">|</span><span class="w"> </span><span class="n">a</span><span class="p">.</span><span class="n">lower_int</span><span class="p">());</span><span class="w"></span>
</pre></div>



<a name="182253448"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/nll-regression/near/182253448" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nll-regression.html#182253448">(Nov 30 2019 at 20:12)</a>:</h4>
<p>The <code>'static</code> bound comes from how we approximate <code>for&lt;'a&gt; 'hir: 'a</code> as <code>'hir: 'static</code>. This specific case is arguably a bug.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>